package com.xuecheng.api.search;

import com.xuecheng.framework.domain.search.CourseBaseSearch;
import com.xuecheng.framework.domain.search.CourseSearchParam;
import com.xuecheng.framework.model.response.QueryResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * Es 搜索接口
 */
@Api(value = "课程搜索接口", tags = {"提供的搜索"})
public interface EsCourseControllerApi {

    /**
     * 分页搜索数据
     *
     * @param page 页码
     * @param size 每页显示多少个
     * @return 结果
     * @pram courseSearchParam 搜索参数
     */
    @ApiOperation("分页搜索课程信息,可以携带参数")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "页码", name = "page", paramType = "path", required = true),
            @ApiImplicitParam(value = "每页显示多少个", name = "size", paramType = "path", required = true)
    })
    QueryResponseResult<CourseBaseSearch> list(int page, int size, CourseSearchParam courseSearchParam);

    /**
     * 根据课程id查询一个数据
     *
     * @param courseId 课程id
     * @return 查询的结果
     */
    @ApiOperation("根据课程id查询一个es中的数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "courseId", value = "课程id", paramType = "path")
    })
    QueryResponseResult<CourseBaseSearch> findByCourseId(String courseId);

}
